package com.example.xyxwebbackend001.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RolesxMapper {

    @Select("SELECT r.role_code " +
            "FROM role_user ur " +
            "JOIN roles r ON ur.ru_id = r.role_id " +
            "WHERE ur.user_id = #{userId}")
    List<String> getRoles(@Param("userId") int userId);
}
